package cuid.sc20.laboratory.service.impl;

import cuid.sc20.laboratory.domain.TbPermission;
import cuid.sc20.laboratory.mapper.TbPermissionMapper;
import cuid.sc20.laboratory.service.ITbPermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 权限Service业务层处理
 *
 * @author ruoyi
 * @date 2023-06-30
 */
@Service
public class TbPermissionServiceImpl implements ITbPermissionService
{
    @Resource
    private TbPermissionMapper tbPermissionMapper;

    /**
     * 查询权限
     *
     * @param id 权限主键
     * @return 权限
     */
    @Override
    public TbPermission selectTbPermissionById(Long id)
    {
        return tbPermissionMapper.selectTbPermissionById(id);
    }

    /**
     * 查询权限列表
     *
     * @param tbPermission 权限
     * @return 权限
     */
    @Override
    public List<TbPermission> selectTbPermissionList(TbPermission tbPermission)
    {
        return tbPermissionMapper.selectTbPermissionList(tbPermission);
    }

    /**
     * 新增权限
     *
     * @param tbPermission 权限
     * @return 结果
     */
    @Override
    public int insertTbPermission(TbPermission tbPermission)
    {
        return tbPermissionMapper.insertTbPermission(tbPermission);
    }

    /**
     * 修改权限
     *
     * @param tbPermission 权限
     * @return 结果
     */
    @Override
    public int updateTbPermission(TbPermission tbPermission)
    {
        return tbPermissionMapper.updateTbPermission(tbPermission);
    }

    /**
     * 批量删除权限
     *
     * @param ids 需要删除的权限主键
     * @return 结果
     */
    @Override
    public int deleteTbPermissionByIds(Long[] ids)
    {
        return tbPermissionMapper.deleteTbPermissionByIds(ids);
    }

    /**
     * 删除权限信息
     *
     * @param id 权限主键
     * @return 结果
     */
    @Override
    public int deleteTbPermissionById(Long id)
    {
        return tbPermissionMapper.deleteTbPermissionById(id);
    }
}
